from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from options import options

driver = webdriver.Chrome(options=options)
driver.get(r'https://www.baidu.com')
sleep(1)
driver.find_element(By.LINK_TEXT,'hao123').click()
title1 = driver.title#打印当前页面标题
print('当前页面是：')
print(title1)
hao123_handle= driver.window_handles[1]

#跳转句柄
driver.switch_to.window(hao123_handle)

title2 = driver.title#打印当前页面标题
print('当前页面是：')
print(title2)

driver.close()
sleep(3)

